import 'package:flutter/material.dart';

/// 首页主题配置 - 现代化卡片式设计 + 白色主题 + 渐变点缀
class HomeTheme {
  // ==================== 配色系统 ====================
  
  /// 背景色
  static const Color backgroundColor = Color(0xFFF8F9FA);
  
  /// 卡片白色
  static const Color cardWhite = Color(0xFFFFFFFF);
  
  /// 主色（红）
  static const Color primaryColor = Color(0xFFD84545);
  static const Color primaryLight = Color(0xFFFF6B6B);
  
  /// 成功（绿）
  static const Color successColor = Color(0xFF4CAF50);
  static const Color successLight = Color(0xFF66BB6A);
  
  /// 信息（蓝）
  static const Color infoColor = Color(0xFF29B6F6);
  static const Color infoLight = Color(0xFF4FC3F7);
  
  /// 警告（橙）
  static const Color warningColor = Color(0xFFFF9800);
  
  /// 紫色
  static const Color purpleColor = Color(0xFF8E24AA);
  static const Color purpleLight = Color(0xFFAB47BC);
  
  /// 文字颜色
  static const Color textPrimary = Color(0xFF333333);
  static const Color textSecondary = Color(0xFF666666);
  static const Color textTertiary = Color(0xFF999999);
  
  /// 分割线颜色
  static const Color dividerColor = Color(0xFFE0E0E0);
  
  // ==================== 渐变定义 ====================
  
  /// 主色渐变（红色）
  static const LinearGradient primaryGradient = LinearGradient(
    colors: [primaryLight, primaryColor],
  );
  
  /// 成功渐变（绿色）
  static const LinearGradient successGradient = LinearGradient(
    colors: [successLight, successColor],
  );
  
  /// 信息渐变（蓝色）
  static const LinearGradient infoGradient = LinearGradient(
    colors: [infoLight, infoColor],
  );
  
  /// 紫色渐变
  static const LinearGradient purpleGradient = LinearGradient(
    colors: [purpleLight, purpleColor],
  );
  
  // ==================== 尺寸定义 ====================
  
  /// 圆角
  static const double radiusSm = 6.0;
  static const double radiusMd = 8.0;
  static const double radiusLg = 10.0;
  static const double radiusXl = 12.0;
  static const double radius2Xl = 16.0;
  
  /// 间距
  static const double spacingXs = 2.0;
  static const double spacingSm = 4.0;
  static const double spacingMd = 6.0;
  static const double spacingLg = 8.0;
  static const double spacingXl = 10.0;
  static const double spacing2Xl = 12.0;
  static const double spacing3Xl = 16.0;
  
  /// 字号
  static const double textXs = 10.0;
  static const double textSm = 12.0;
  static const double textBase = 13.0;
  static const double textMd = 14.0;
  static const double textLg = 15.0;
  static const double textXl = 17.0;
  static const double text2Xl = 20.0;
  
  /// 图标尺寸
  static const double iconXs = 10.0;
  static const double iconSm = 14.0;
  static const double iconMd = 16.0;
  static const double iconLg = 20.0;
  static const double iconXl = 24.0;
  
  // ==================== 阴影定义 ====================
  
  /// 卡片阴影（Level 1）
  static BoxShadow get cardShadow => BoxShadow(
        color: Colors.black.withOpacity(0.04),
        blurRadius: 6,
        offset: const Offset(0, 2),
      );
  
  /// 图片阴影（Level 2）
  static BoxShadow get imageShadow => BoxShadow(
        color: Colors.black.withOpacity(0.06),
        blurRadius: 8,
        offset: const Offset(0, 2),
      );
  
  /// 浮动阴影（Level 3）
  static BoxShadow get floatShadow => BoxShadow(
        color: Colors.black.withOpacity(0.08),
        blurRadius: 10,
        offset: const Offset(0, 4),
      );
  
  /// 渐变阴影（主色）
  static BoxShadow get primaryShadow => BoxShadow(
        color: primaryColor.withOpacity(0.3),
        blurRadius: 8,
        offset: const Offset(0, 2),
      );
  
  /// 渐变阴影（成功色）
  static BoxShadow get successShadow => BoxShadow(
        color: successColor.withOpacity(0.3),
        blurRadius: 8,
        offset: const Offset(0, 2),
      );
  
  /// 渐变阴影（信息色）
  static BoxShadow get infoShadow => BoxShadow(
        color: infoColor.withOpacity(0.3),
        blurRadius: 8,
        offset: const Offset(0, 2),
      );
  
  // ==================== 装饰器定义 ====================
  
  /// 标准卡片装饰
  static BoxDecoration get cardDecoration => BoxDecoration(
        color: cardWhite,
        borderRadius: BorderRadius.circular(radiusXl),
        boxShadow: [cardShadow],
      );
  
  /// 渐变卡片装饰（主色）
  static BoxDecoration get primaryCardDecoration => BoxDecoration(
        gradient: primaryGradient,
        borderRadius: BorderRadius.circular(radiusXl),
        boxShadow: [primaryShadow],
      );
  
  /// 渐变卡片装饰（成功色）
  static BoxDecoration get successCardDecoration => BoxDecoration(
        gradient: successGradient,
        borderRadius: BorderRadius.circular(radiusXl),
        boxShadow: [successShadow],
      );
  
  /// 渐变卡片装饰（信息色）
  static BoxDecoration get infoCardDecoration => BoxDecoration(
        gradient: infoGradient,
        borderRadius: BorderRadius.circular(radiusXl),
        boxShadow: [infoShadow],
      );
  
  /// 图标容器装饰
  static BoxDecoration iconDecoration(Color color) => BoxDecoration(
        color: color.withOpacity(0.1),
        borderRadius: BorderRadius.circular(radiusMd),
      );
  
  /// 渐变图标容器装饰
  static BoxDecoration gradientIconDecoration(LinearGradient gradient) => BoxDecoration(
        gradient: gradient,
        borderRadius: BorderRadius.circular(radiusMd),
      );
  
  // ==================== 文字样式定义 ====================
  
  /// 标题样式（XL）
  static const TextStyle titleXlStyle = TextStyle(
    fontSize: textXl,
    fontWeight: FontWeight.bold,
    color: textPrimary,
    height: 1.2,
  );
  
  /// 标题样式（LG）
  static const TextStyle titleLgStyle = TextStyle(
    fontSize: textLg,
    fontWeight: FontWeight.bold,
    color: textPrimary,
  );
  
  /// 次标题样式
  static const TextStyle subtitleStyle = TextStyle(
    fontSize: textMd,
    fontWeight: FontWeight.w600,
    color: textPrimary,
  );
  
  /// 正文样式
  static const TextStyle bodyStyle = TextStyle(
    fontSize: textBase,
    fontWeight: FontWeight.w500,
    color: textPrimary,
    height: 1.4,
  );
  
  /// 辅助文字样式
  static const TextStyle captionStyle = TextStyle(
    fontSize: textSm,
    fontWeight: FontWeight.w500,
    color: textSecondary,
  );
  
  /// 标签样式
  static const TextStyle labelStyle = TextStyle(
    fontSize: textSm,
    fontWeight: FontWeight.w600,
    color: textTertiary,
  );
  
  /// 按钮文字样式
  static const TextStyle buttonStyle = TextStyle(
    fontSize: textMd,
    fontWeight: FontWeight.w600,
    color: cardWhite,
  );
}
